// -----------------------------------------------------------------------
//  <copyright file="IDataAuthorizationService.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2025 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025-02-27 15:02</last-date>
// -----------------------------------------------------------------------

using DaprPlus.Filters;


namespace DaprPlus.Authorization;

/// <summary>
/// 定义数据权限验证服务
/// </summary>
public interface IDataAuthorizationService
{
    // 应用数据过滤条件到查询
    IQueryable<T> ApplyDataFilters<T>(IQueryable<T> query, FilterGroup filterGroup) where T : class;

    /// <summary>
    /// 检查单个实体是否符合数据权限
    /// </summary>
    bool CheckEntityAccess<T>(ResourceOperation operation, FilterGroup filterGroup, params T[] datas) where T : class;
}
